﻿<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// Add Mootols library
JHtml::_('behavior.mootools');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.modal');

// Add stylesheet & Javascript
$document =& JFactory::getDocument();
$document->addStyleSheet( JURI::base().'components/com_geotrails/assets/css/style.css' );

if ($this->params->get('show_search_form')) {
	$document->addScript(JURI::root()."components/com_geotrails/assets/js/ajax_search.js");
}

if ($this->params->get('show_paginate')) {
	if (!$this->params->get('show_search_form')) {
		$document->addScript(JURI::root()."components/com_geotrails/assets/js/ajax_search.js");
	}
	
	$document->addScript(JURI::root()."components/com_geotrails/assets/js/ajax_search_paginate.js");
}
?>
<div id="com_geotrails">
	<div class="rss">
		<a href="<?php echo JRoute::_('index.php?option=com_geotrails&view=maps&format=raw&layout=default_map_zoom&fullscreen=1&Itemid='.$this->Itemid, false); ?>" class="modal" alt="<?php echo JText::_('COM_GEOTRAILS_VIEW_MAP'); ?>" rel="{handler: 'iframe', size: {x: 1024, y: 768}}" >
			<?php echo JHtml::image(JURI::root().'components/com_geotrails/assets/images/view_map_zoom.jpg', JText::_('COM_GEOTRAILS_VIEW_LIST'), array('align' => 'middle')); ?>
		</a>
		<a href="<?php echo JRoute::_('index.php?option=com_geotrails&view=geotrails', false); ?>" >
			<?php echo JHtml::image(JURI::root().'components/com_geotrails/assets/images/view_list.jpg', JText::_('COM_GEOTRAILS_VIEW_MAP'), array('align' => 'middle')); ?>
		</a>
		<a href="<?php echo JRoute::_('index.php?option=com_geotrails&view=geotrails&format=feed', false); ?>" >
			<?php echo JHtml::image(JURI::root().'components/com_geotrails/assets/images/icon-rss.jpg', JText::_('COM_GEOTRAILS_VIEW_GEOTRAILS_RSS'), array('align' => 'middle')); ?>
		</a>
	</div>
	<?php if (strlen($this->title)) { ?>
	<h2><?php echo $this->title; ?></h2>
	<?php } ?>
	<?php if ($this->params->get('show_search_form')) { ?>
		<?php $pane =& JPane::getInstance('sliders', array('startOffset'=>-1, 'startTransition'=>0, 'allowAllClose' => true)); ?>
		<?php echo $pane->startPane( 'com_geotrails_maps_pane' ); ?>	
		<?php echo $pane->startPanel( JText::_('COM_GEOTRAILS_VIEW_FILTER'), 'com_geotrails_maps_slide1' ); ?>
		<?php echo $this->loadTemplate('search'); ?>
		<?php echo $pane->endPanel(); ?>
		<?php echo $pane->endPane(); ?>
	<?php } ?>
	<div id="com_geotrails_loading"></div>
	<div id="com_geotrails_content_map">
		<?php if ($this->gmap) { ?>
		<?php echo $this->loadTemplate('map'); ?>
		<?php } ?>
	</div>
	<?php echo $this->loadTemplate('paginate'); ?>
</div>